/*
 * Created on Nov 21, 2003
 */
package com.unash.asn;


/**
 * @author Ashwini Gokhale
 */
import java.io.UnsupportedEncodingException;

import com.unash.util.Consts;

public class AsnVisibleString implements Consts{
	String value;
	
	public AsnVisibleString(String value){
		this.value = value; 
	}//AsnVisibleString(String value)
	
	
	public String toString(){
		return value;
	}//toString
	
	
	public int hashCode(){
		return value.hashCode();
	}//hashCode
	
	
	public boolean equals(Object obj){
		if(!(obj instanceof AsnVisibleString))
			return false;
		AsnVisibleString objAsnVisibleString = (AsnVisibleString)obj;
		return value.equals(objAsnVisibleString.value);
	}//equals
	
	
	byte[] getBytes() throws UnsupportedEncodingException{
		return value.getBytes(VISIBLE_STRING_CHARSET);
	}//getBytes()
	
}//AsnVisibleString